package net.yxsoft.controller.pc.sysmgt;
import com.jfinal.aop.Clear;
import com.jfinal.kit.PropKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import net.yxsoft.controller.pc.sysmgt.common.AuthController;
import rapid.core.Authuser;

import java.util.List;

public class BlockchainManagementController extends AuthController {

    /**
     * 返回前端页面
     * */
    @Clear
    public void index() {
        render("index.html");
    }


    /**
     * 合约仓库
     * */
    @Clear
    public void contractsStore(){
        List<Record> recordList = Db.find("SELECT * FROM fn_form_data WHERE attrib_01=(SELECT id FROM fn_form WHERE code='hyck')");
        set("recordList",recordList);
        render("contractsStore.html");
    }

    /**
     * 智能合约地址
     * */
    public void smartContractsIndex(){
        Authuser loginUser = getLoginUser();
        String smartContractsUrl = PropKit.get("smartContractsUrl");
        redirect(smartContractsUrl+"?userid="+loginUser.get("LOGIN_ID"));
    }

}
